package com.smartdio.company.editor;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;

import com.smartdio.company.extention.IPersonEditor;
import com.smartdio.company.model.Person;

public class EditorExtentDemo implements IPersonEditor {
	private Text text ;

	@Override
	public Control createPartControl(Composite parent) {
		Group group = new Group(parent,SWT.None);
		group.setText("备注");
		group.setLayout(new FillLayout());
		text = new Text(group,SWT.BORDER|SWT.MULTI);
		return group;
	}

	@Override
	public Object getValue(Person person) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void putPersonValue(Person person) {
		String name = person.name;
		text.setText("这是关于"+name+"的详细备注说明。用于演示扩展编辑器");

	}

}
